package com.dingjian.broker.enums;

/**  客户用途
 * @author google
 *
 */
public enum CustomerPurposeEnum {
	INVEST("投资",1),
	OWNER_OCCUPIED("自住",2);
	
	private String desc;
	private int value;

	private CustomerPurposeEnum(String desc, int value){
		this.desc = desc;
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}
	
	public static CustomerPurposeEnum getEnum(int value){
		CustomerPurposeEnum resultEnum=null;
		CustomerPurposeEnum[] enumAry=CustomerPurposeEnum.values();
		for(int i=0;i<enumAry.length;i++){
			if(enumAry[i].getValue()==value){
				resultEnum=enumAry[i];
				break;
			}
		}
		return resultEnum;
	}
}
